package com.wang.rabbitmq.springboot.deadqueue;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author: wang
 * @date: 2021/8/4 19:34
 * @description:
 */
@Component
public class Sent {

    @Resource
    private AmqpTemplate amqpTemplate;

    public void sentMessage(){
        for (int i = 0; i < 30; i++) {
            amqpTemplate.convertAndSend("directExchange", "directQueue-key", "你好哇 ："+i);
        }
    }
}
